package com.markedquilt.solution;
/*
 * PackageName: com.markedquilt.SwordForOffer
 * Author:   coke
 * Date:     Created in 2020/11/15 0:26
 * Description:
 * History:
 * <author>        <time>             <version>          <desc>
 * 作者姓名         修改时间            版本号              描述
 * coke           2020/11/15 0:26     1.0
 */

import java.util.HashMap;
import java.util.Map;

/**
 * @author ZhangKe
 * @Description
 * @date 2020/11/15 0:26.
 */
public class num217ContainsDuplicate {
    public static boolean containsDuplicate(int[] nums) {
        Map<Integer,Integer> count = new HashMap<Integer,Integer>();
        for (int i = 0; i < nums.length; i++) {
            if (count.containsKey(nums[i]))
                return true;
            count.put(nums[i],1);
        }
        return false;
    }

    public static void main(String[] args) {
        int[] array = {3,2,5,0,9,2,0};
        System.out.println(containsDuplicate(array));
    }
}
